package com.hiyee.article.consumer;

import com.hiyee.api.config.RabbitMqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class ArticleConsumer {

    @RabbitListener(queues = {RabbitMqConfig.QUEUE_NAME})
    public void handle(String payload, Message message) {
        System.out.println("[消费者] routeKey：" + message.getMessageProperties().getReceivedRoutingKey());
        System.out.println("[消费者] 正在消费的消息：" + payload);
    }
}
